﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Jinjia.Approve.Entity.Entity.JJFlow;

namespace Jinjia.Approve.IRepository.JJFlow
{
    public interface IFlowNodeEmpRepository
    {
        /// <summary>
        /// 根据节点id获取节点人员
        /// </summary>
        /// <param name="nodeId"></param>
        /// <param name="templateId"></param>
        /// <returns></returns>
        Task<List<jj_flow_node_emp>> GetByNodeId(int nodeId, int templateId);

        Task PhysicalDelete(int id);
        Task PhysicalDelete(List<int> ids);

        Task<int> Save(jj_flow_node_emp data);
        Task Save(List<jj_flow_node_emp> data);

        /// <summary>
        /// 获取指定审批人
        /// </summary>
        /// <param name="template_id"></param>
        /// <param name="node_id"></param>
        /// <returns></returns>
        Task<List<int>> GetUserIdByNodeId(int template_id, int node_id);

        /// <summary>
        /// 获取指定角色
        /// </summary>
        /// <param name="template_id"></param>
        /// <param name="node_id"></param>
        /// <returns></returns>
        Task<List<string>> GetRoleCodeByNodeId(int template_id, int node_id);
        
        /// <summary>
        /// 审批模板替换审批人
        /// </summary>
        /// <param name="handoverUserId"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<bool> ChangeApprover(int handoverUserId, int userId);
    }
}